package laya.util;

public class SerialNoFactory4B extends SerialNoFactory
{
	public SerialNoFactory4B(ProductCode4B oCode, int nKey, String strSample)
	{
		super(oCode, nKey, strSample);
	}
	public long hashCodeOpt()
	{
		return hashCodeOpt((int)m_nKey, m_vOpt);
    }
    
    public static int hashCodeOpt(int nKey, char[] vOpt)
    {
		int sum = 0;
		int multiple = (int)(nKey & 0x00000000ffffffffl);
		int index = 1;

		for (int i = 0; i < vOpt.length; i++)
		{
			sum += multiple * index++ * vOpt[i];
			multiple *= nKey;
		}
		
		return(sum);
    }
}